class Solution {//leetcode409——最长回文串
public:
    int longestPalindrome(string s) {
        unordered_map<char,int> hash;
        for(auto ch:s){
            hash[ch]++;
        }
        int ret=0;
        for(auto [x,y]:hash){
            ret+=(y/2)*2;
        }
        if(ret<s.size()){
            ret+=1;
        }
        return ret;
    }
};